package com.m2bshop.shop.dao;

import com.m2bshop.shop.pojo.Sysparam;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SysparamDao {

    @Select("select count(*) from sysparam")
    public int count();

    @Select("select * from sysparam") //查询所有系统参数
    public List<Sysparam> findall();

    @Select("select * from sysparam where id=#{id}")    //根据ID查询系统参数
    public Sysparam findbyid(int id);

    @Insert("insert into sysparam(ppkey, paravalue, paradescrip) values(#{ppkey}, #{paravalue}, #{paradescrip})")   //新增系统参数
    public int insertone(Sysparam sysparam);

    @Delete("delete from sysparam where id=#{id}")  //按id删除
    public int deleteone(int id);

    @Update("update sysparam set ppkey=#{ppkey}, paravalue=#{paravalue}, paradescrip=#{paradescrip} where id=#{id}")    //按id修改
    public int updateone(Sysparam sysparam);
}
